package com.daoyin.ssph.service.impl;

import java.util.List;

import com.daoyin.ssph.bean.Translation;
import com.daoyin.ssph.dao.TranslationDAO;
import com.daoyin.ssph.service.TranslationService;

public class TranslationServiceImpl extends BaseServiceImpl<Translation> implements TranslationService{
	private TranslationDAO dao;
	
	public void setDao(TranslationDAO dao) {
		this.dao = dao;
	}
	
	@SuppressWarnings("unchecked")
	public List<Translation> query(){
		List<Translation> list = dao.findAll();
		return list;	
	}
	public String add(Translation translation){
		dao.save(translation);
		return "success";		
	}
	
	public Translation query(Integer id){
		Translation translation = dao.findById(id);
		
		return translation;	
	}
	public void delete(Integer id){
		Translation translation = dao.findById(id);
		dao.delete(translation);
	}
	
	public String update(Translation t){
		dao.merge(t);
		return "success";
	}
}
